package com.erastep.util
{
	import flash.events.StatusEvent;
	import flash.net.LocalConnection;
	import flash.net.NetConnection;
	
	import mx.controls.Alert;

	/**
	 * @depart 宁波分公司
	 * @author Jarvis
	 * @date 2011/7/7
	 * */
	public class LogUtil
	{
		private static var conn:LocalConnection;
		
		public static var netc:NetConnection;
		
		public static function print(str:String,color:String = "red"):void{
			try
			{
				if(conn == null){
					conn = new LocalConnection();
					conn.addEventListener(StatusEvent.STATUS,function(e:StatusEvent):void{
						//trace(e.level);
					})
				}
				trace(str);
				conn.send("_myConnection", "lcHandler", str,color);
				//网络端打印客户端信息
				if(netc){
					
				}
			} 
			catch(error:ArgumentError) 
			{
				trace("可能是数据过大,导致的日志无法打印,但不影响您的任何工作!");
			}
		}
		
		public static const GREEN:String = "green";
		
		public static const YELLOW:String = "yellow";
		
		public static const BLACK:String = "black";
		
		public static const RED:String = "red";
	}
}